Teaching the Modeling of Human–Environment Systems: Acknowledging Complexity with an Agent-Based Model

Agent-based modeling is a promising tool for familiarizing students with complex systems as well as programming skills. Human–environment systems, for instance, entail complex interdependencies that need to be considered when modeling these systems. This complexity is often neglected in teaching modeling approaches. For a heterogeneous group of master’s students at a German university, we pre-built an agent-based model. In class, this was used to teach modeling impacts of land use policies and markets on ecosystem services. As part of the course, the students had to perform small research projects with the model in groups of two. This study aims to evaluate how well students could deal with the complexity involved in the model based on their group work outcomes. Chosen indicators were, e.g., the appropriateness of their research goals, the suitability of the methods applied, and how well they acknowledged the limitations. Our study results revealed that teaching complex systems does not need to be done with too simplistic models. Most students, even with little background in modeling and programming, were able to deal with the complex model setup, conduct small research projects, and have a thoughtful discussion on the limitations involved. With adequate theoretical input during lectures, we recommend using models that do not hide the complexity of the systems but foster a realistic simplification of the interactions. Supplementary Information The online version contains supplementary material available at 10.1007/s10956-022-10022-z.


I.i Purpose:
The purpose of the model is to analyze the influence of policies and markets on land use decisions of dairy farms. The land use decisions made, determine the delivered ecosystem services on the landscape level. The user can choose a combination of five policy options, as well as how strongly market prices fluctuate. A suitable choice of policy options simultaneously fulfills the following three "political goals" i) economic viability of dairy farming, ii) safeguarding ecosystem services at a certain level, and iii) spending as little money as possible on subsidies. The model has been designed for students to practice agent-based modeling and its respective output analysis.

I.ii. Entities, state variables, and scales
The model comprises a human-environmental landscape consisting of three types of entities: dairy farm agents (representing farming households), field agents (representing land parcels), and a governance structure (observer setting exogenous factors). Dairy farms' state variables include the farm location, a farm id (linking the farm to its fields), a set of fields that belong to the farm, the number of cows that the farm owns, received (traded) manure, its intended farm size change (downsize, expand or no change) and an intensity scale (from 1 to 4). The fields' state variables are the location, the size (in ha), a field id, the id of the farm that the field belongs to (tenant), a factor of soil fertility, its land use (grassland vs. cropland), the amount of organic and mineral fertilizers used on the field (in kg N/year), as well as the number of cuts the field receives (if grassland). The governance structure is represented by five different policy options, including i) a fine on organic nitrogen surplus, ii) a ban on grassland conversion, iii) subsidy heights for different land uses, iv) redistributive subsidies, and v) emission taxes. Each of these also encompasses several options regarding the exact settings for the respective policy option (e.g., level of fine for organic nitrogen surplus).
The model is a spatially explicit model, taking into account the exact location of farms and fields. The user can choose between a real-world example and a random world setup (random distribution of farms and allocation of fields around farms). Each time step corresponds to one year. One model run covers a period of 30 years.

I.iii. Process overview and scheduling
Within each year, a sequence of activities takes place in the following order (see Fig. 1): First, each dairy farm decides to continue or to stop farming. The next step is a decision on the farm's strategy in terms of changing either its intensity or size. This decision is based on its annual profit in relation to the profit of the majority of other farms. Based on the farm strategy, the next step is an interaction on the land market trying to either lease new or give away land, followed by updating its farm size. Consequently, the farm decides on the land use of its fields (depending on the chosen farm intensity), whether they are cultivated with crops or utilized as grassland. Depending on the new farm size and intensity scale, the farm specifies the number of cows it will hold in the upcoming year and how much manure its cows produce. The farm will then interact on the manure market and potentially exchange manure with other farms. Following this, the farm fertilizes its fields with organic and mineral fertilizers, after which farms harvest their fields, determine the feed value of the grass, feed the cows, and determine the volume of milk their cows produce. The milk will then be sold at a set market price generating income for the farms. Before the farm's profit is calculated (depending on market prices and policy settings), the impacts of the land use decisions on a selected set of ecosystem services are determined.

II.i Theoretical and empirical background
The underlying background of this agent-based model is to function as a tool for the impact assessment of policy and market instruments on land use and a selected set of ecosystem services. The modules on decision-making and interactions on land and manure markets are restricted by the limited information available to dairy farms. They have no foresight into the future and are satisfied when reaching a certain minimum income, which can be assessed in relation to their peers. The observer's policy and market decisions are linked to real-world cases but are still greatly simplified. It is furthermore assumed that a central authority owns all land, and farms do not own but only lease land. With the decision style "based on profit", a special form of profit maximization was used as a behavioral theory. Farmers' decision-making for the two strategy decisions -size and intensity -impact all the following steps in each time step. How the profit maximization is implemented is based on the average profit of the other farms. Per size class (four classes) as well as per intensity scale (four levels of intensity), the financially most successful strategy is determined. If the annual income of a farm is below a certain percentage (the percentage can be set by the user to a value between 10% and 90%) of the most successful strategy, it changes -under certain conditions 2 -its strategy in the direction of the most successful strategy.
This decision style was chosen due to its simplicity but also due to its similarity to realworld decisions. Imitation of other, more profitable farm strategies is widely seen as a prominent decision style (Le et al. 2010). The level of decision-making is on the farm scale.

II.ii. Individual decision-making
The subjects of the model are the farms deciding on the state of the fields. The observer makes further decisions in terms of policies and markets that affect the decision-making of the subjects as well as the state of the fields. The farms do not have any further, specific objectives to follow besides reaching a certain annual profit in relation to their social environment. The farms adapt their behavior depending on the decision style and decision strategy taken, but also depending on the situation of the land and manure market as well as depending on given policies and market scenarios.
Social norms influence behavior through the responsibility to follow policies. Cultural values are not further reflected in the decision-making. Space is explicitly included in the decision-making as the distance between the farm and the fields plays an essential role in deciding on fields to lease and its overall income. Temporal aspects are essential for decisionmaking, depending on whether the observer allows intensity changes every year, every three or five years. Also, the decision to stop farming is based on a number of years (set by the observer) and hence requires memory of the farms. Uncertainty is not explicitly included in the decision rules. Nevertheless, farms base their decisions on the income distribution of farms in the previous year. Hence, they take a certain risk as they do not know about the current year's land market, manure market, and price developments.

II.iii Learning
No individual or collective learning is included in the model II.iv. Individual sensing Dairy farms sense the annual profit of other farms as described under individual decisionmaking. Additionally, farms sense the productivity of land, the distance to fields, the policies that are in force, the market value of milk, prices for land as well as manure. Information are updated every year.

II.vi. Interaction
Interaction between dairy farms takes place in the land and manure markets. The interaction depends on spatial distance, the amount of resources available, and the policies set by the observer.

II.vii. collectives
No collectives are included in the model.

II.viii. Heterogeneity
Dairy farms have different goals (based on their individual decision-making) and act differently depending on the farming style (intensity scale) they follow for the year. Fields have different outputs depending on their productivity and their land use (cropland versus grassland).

II.ix. Stochasticity
In the random world setup, the farm location, the livestock density, and the allocation of fields to nearby farms are determined in a stochastic process. In addition, the market prices (producer prices for milk and fertilizer prices) can be chosen to fluctuate randomly.

II.x. Observation
The development of land use, amount, and size of farms can be observed at the GUI. Furthermore, the observer can follow the development of milk, and fertilizer prices, subsidy levels for cropland and grasslands, farm and profit distributions, government expenditures and earnings, as well as impacts on ecosystem services.

III.i. Implementation details
The model was written and implemented in NetLogo 6.0.4 , including a GIS extension.

III.ii. Initialization
The model can be initialized in two different versions, which the observer can decide upon before setting up the world. In the "random-world", 175 farms (with random farm sizes), approx. 5000-6000 cows and 10101 fields are distributed randomly in the world. The farms are categorized into 4 size classes (small (< 20 ha), medium (> 20 ha and < 75 ha), large (> 75 ha and < 100 ha), extralarge (> 100 ha)). If at least 3 large farms were created, neighboring fields are assigned to 0 to 3 of them until they are extralarge with a size between 100 ha and 125 ha. The grassland share of each farm is assigned approximately (with a normal distribution) in accordance with its intensity scale (see Table 1). In the "GIS-world", 145 farms, 4949 cows, and 923 fields are distributed realistically. The "GIS-world" is the same at any setup and not subject to change, while the distribution of the "random-world" is subject to randomization. The initial farm and cow density per hectare of the two worlds is approximately similar and hence comparable to a certain degree. The initial state of ecosystem services is set to an index of 100. Farms are initialized into four different categories. In the "GIS-world", 41 farms are veryextensive, 42 are extensive, 13 are intensive, and 48 are very intensive. In the random world, the distribution varies. The intensity scales are defined in Table 1.

III.iii. Input data
The model uses GIS data as input data for the model setup in the GIS version (study region in Southern Bavaria). Several values used in the model needed parametrization. A complete overview of these values, including information on which submodel they were involved in as well as how and from which source they were obtained, can be found in Table 2 at the end of this protocol. III.iv. Submodels

III.iv.i Stop farming?
At the beginning of each year, farms decide whether they must stop farming. A farm stops operating after a certain amount of years in a row with a low profit. The number of years needed (1-10 years), as well as the minimum profit (5000-20000€), can be set by the observer at the interface.

III.iv.ii Decide farm strategy
Dairy farms must determine whether to continue with their current intensity and size or adjust these. For this decision, which is based on profit, each farm compares its annual profit to the profit of other farms. For the four size classes (small, medium, large, extralarge) and intensity levels (see Table 1), the mean annual profit is given as a global variable. If the farm's annual profit is below a certain threshold (to be set by the observer via the interface) of a different class's income, it will change its strategy one step in the direction of the most successful farm class. For the farm's intensity, however, the observer can choose via the interface whether the farm is allowed to change its intensity scale every year or only every five years. A farm size change is possible every year by default. Finally, there is one special case for intensity changes: Farms with less than five cows have to intensify.

III.iv.iii Interact in the land market
If the farm's intention is to change the farm size, the farm will interact in the land market.
With an intention to decrease farm size, 10% of the most distant fields (number of fields, not the number of hectares) will be labeled "for-lease". If the farm only has five or less fields left, one field (the most distant one) will be set "for-lease". Fields of farms that stopped farming are now also labeled "for-lease". Fields are then distributed to farms (by annual income in descending order) that have the intention to increase their farm size until either all tenants are satisfied, or all fields in the list are taken. This is because successful farms with a high income are also more powerful and more engaged in the land market. The farms always choose the fields closest to the location of the farm.

III.iv.iv Set main land use
Depending on whether a grassland-conversion-ban is enabled (see submodel in policy implementation below), the farm decides every year whether fields are cultivated with crops or as grassland. With an enabled grassland-conversion ban (only conversion from cropland to grassland possible): • very-extensive farms only cultivate grasslands.
• extensive farms make sure that at least 85% of their fields are grasslands.
• intensive farms make sure that at least 70% of their fields are grasslands.
• very intensive farms make sure that at least 50% of their fields are grasslands. With no grassland-conversion ban enforced (conversion from cropland to grassland as well as from grassland to cropland is possible): • very extensive farms only cultivate grasslands.
• extensive farms make sure their grassland share is equivalent to ~ 85% of their fields.
• intensive farms make sure their grassland share is equivalent to ~ 70% of their fields.
• very intensive farms make sure their grassland share is equivalent to ~ 50% of their fields.

III.iv.v Set number of cows and manure quantity
Dairy farms set the number of cows that the farm holds. This is based both on the previous decision on how much land the farm is leasing as well as the intensity scale in terms of how many cows per hectare the farm owns. Cows are allocated to farms randomly within the ranges defined in Table 1.

III.iv.vi Exchange manure
Dairy farms interact in the manure market. This is based on the balance of organic nitrogen of the farm. Firstly, the manure pool is created based on the excess manure of the farms which produce more manure than could legally be applied to their fields (the default limit is 170 kg N/ha, but can be adjusted via the interface if policy option 1 is active). Secondly, a list of interested 'receivers' is created for farms that are below the limit and would like to fertilize their fields with more manure. This list contains only intensive and very intensive farms, as they are assumed to have the highest interest in increasing their fertilization. Very intensive farms are served first, beginning with farms having the highest organic nitrogen deficit. Then intensive farms are served, again beginning with the highest organic nitrogen deficit within this intensity level. Depending on the amount of manure given or collected, the available manure per farm is defined.

III.iv.vii Fertilize fields
The available manure is spread onto the respective fields of the farms. Intensive and very intensive farms are also adding mineral fertilizer to their fields to reach an overall nitrogen fertilization level of 200 or 300 kg N/ha, respectively, if the organic manure available does not suffice to meet this demand.

III.iv.viii Harvest fields
Based on the land use type (cropland or grassland field), a given soil fertility factor of each field, the number of hectares cultivated, the number of cuts (if grassland), the amount of nitrogen fertilization, and the average harvest (per cut for grassland, per year for cropland), the feed quantity value (referred to as "net energy content for lactation" in the dairy sector) per field is specified and summed for the entire farm.

III.iv.ix Feed, milk cows, and sell milk
The specified quantity of feed will then be fed to cows. An average productivity of 6748 kg of milk per year and cow is assumed, but the actual productivity depends on the feed quantity value each cow receives. The milk is then sold on the market, whereas extensive farms (intensity scale 1 or 2) receive a higher price per unit milk than intensive farms (intensity scale 3 or 4). This approximates the higher price consumers are often willing to pay for extensively produced products (e.g., organic milk).

III.iv.x Influence ecosystem services
To assess impacts on ecosystem services, indices ranging from 0 (very bad) to 100 (very good) for climate regulation, water quality, habitat quality and soil fertility are calculated. Climate regulation is based on the sum of greenhouse gases emitted by each farm, including CH4 (determined by the number of cows), N2O (different emission factors between grassland and cropland, depending on fertilizer input) and CO2 (grasslands as sink, croplands as source). Soil fertility is enhanced for fields cultivated as grasslands (while depending on the intensity scale of the corresponding dairy farm) and reduced for fields cultivated as croplands summing up to the soil fertility index. As a proxy for the water quality, the overall nitrate output per area is assessed (strength of nitrate output depends on land use and fertilizer intensity). Those grassland fields that are below a certain threshold regarding their number of cuts and their fertilizer input are assumed to have a certain habitat value and by that contribute to the provision of the ecosystem service habitat quality.

III.iv.xi Calculate interim profit
Firstly, field-based income (subsidies) and costs (lease and labor cost) are calculated. Subsidies and lease costs depend on the land use. Labor costs additionally depend on the distance between farms and field and the management intensity (applied fertilizer and -for grassland -number of cuts). In a second step, farms sum up the values on farm level. If the policy option of redistributive subsidy payments is chosen and farms exceed the size limit, a certain share of subsidies is deducted. The input costs on farm level depend on farm size and milk output and, apart from general costs, include the costs for mineral fertilizers used as well as trade costs for manure (both for the donor and the receiver, to account for the needed efforts connected with the manure exchange). The total annual interim profit includes hence on the income side the received subsidies and the received market value and on the expenditure side the land lease, the labor costs as well as the input costs.

III.iv.xii React to policies and set final profit
Policies (if chosen) are implemented in the following order: • Policy option 1: Determine fines for farms that exceed the allowed level of average organic nitrogen per hectare on their fields after manure trade. The limit of organic nitrogen (100-220 kg/ha), the height of the fine (subsidy reduction of 1-30%) and the percentage of farms that are checked annually (1-100%) have to be set by the observer via the interface • Policy option 2: Ban grassland conversion if the total share of grasslands falls below the threshold (51-100%) defined by the observer via the interface. • Policy option 3: Subsidy levels for differing land use and management: Cropland, intensive and extensive grassland are set via the interface (applicable in the next time step). Extensive grasslands are those with no mineral fertilizer application and limited organic nitrogen application (threshold of when an organic nitrogen level is considered extensive is set via the interface to 0-110 kg/ha). If this policy option is switched off in the interface, default values of 300 €/ha subsidies, an organic nitrogen threshold of 110 kg/ha and 350 €/ha additional subsidies for extensive grassland are defined. • Policy option 4: Redistributive subsidies depending on farm size. The threshold for the farm size (20-100 ha) and the height of the subsidy reduction per ha of farm area exceeding the (5-100%) has to be set by the user. This policy option is implemented in the "calculate interim profit" submodel (see above).
• Policy option 5: Taxes for greenhouse gas and nitrate emissions per dairy farm (height defined by the observer) apply if the area-wide threshold (as defined by the observer) is exceeded.
The final profit then consists of the interim profit minus a potential fine (for exceeding the organic nitrogen limit) minus taxes paid (nitrate and greenhouse gas tax, respectively).
harvest-fields Increase in "Net energy content for lactation" depending on N input 0.004 MJ/kg N The source gives a NEL of 5.69 MJ kg-1 for 70 kg of N fertilization and 6.01 MJ kg-1 for 150 kg. Assuming linear relationship.
(2) "Net energy content for lactation" of grass 5.63 MJ/kg dry mass Mean of all maturity levels of grass for first and second cut (between 5.67 and 7.06 MJ/kg dry mass -> 6.28 MJ/kg dry mass). Normalizing to 0 kg N input: N input recommendation of LfL (Source 2: Table 30 Factor for the dependency of milk output per year on the "Net energy content for lactation" 36831 MJ Food supply recommendation for cows dependent on daily milk production -> demand per cow: 3.3 MJ NEL/kg milk per day (= 1205 MJ NEL/kg milk per year). Based on that linear relation, the factor was calculated for the standard milk output assumed in this model (6748 kg/cow/a).